import torch
from torch import nn


class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.fc1 = nn.Linear(28*28,512)
        # self.relu1 = nn.ReLU()
        self.fc2 = nn.Linear(512,256)
        # self.relu2 = nn.ReLU()
        self.fc3 = nn.Linear(256,128)
        # self.relu3 = nn.ReLU()
        self.fc4 = nn.Linear(128,64)
        # self.relu4 = nn.ReLU()
        self.fc5 = nn.Linear(64,10)
        self.softmax = torch.nn.Softmax(dim=1)

        self.relu = nn.ReLU()
    def forward(self, x):
        # x = x.view(x.shape[0],-1)
        x = self.fc1(x)
        x = self.relu(x)
        x = self.fc2(x)
        x = self.relu(x)
        x = self.fc3(x)
        x = self.relu(x)
        x = self.fc4(x)
        x = self.relu(x)
        x = self.fc5(x)
        out = self.softmax(x)
        return out
if __name__ == '__main__':
    x=torch.randn(1,28*28)
    net = Net()
    output = net.forward(x)
    print(output.shape)